/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package beans;

import CRUD.MemberHome;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import net.tanesha.recaptcha.ReCaptchaImpl;
import net.tanesha.recaptcha.ReCaptchaResponse;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.upload.FormFile;
import xmlMapping.Member;

/**
 *
 * @author labib
 */
public class RegisterBeanForum extends org.apache.struts.action.ActionForm {

   private String userName;
 private   String password;
  private  String email;
  private  String firstName;
  private  String lastName;
  private  String birthday;
 private String street;
  private  String city;
   private String country;
   private FormFile img;
   private String []newdate;
String imageName;

    public String getImageName() {
        return imageName;
    }

    public void setImageName(String imageName) {
        this.imageName = imageName;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public FormFile getImg() {
        return img;
    }

    public void setImg(FormFile img) {
        this.img = img;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String[] getNewdate() {
        return newdate;
    }

    public void setNewdate(String[] newdate) {
        this.newdate = newdate;
    }

    public RegisterBeanForum() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        
//        if (getUserName() == null ) {
//            errors.add("userName", new ActionMessage("UserNameError"));
//            // TODO: add 'error.name.required' key to your resources
//        }
//
//        if (getPassword() == null||getPassword().length()<6 ) {
//            errors.add("password", new ActionMessage("Password"));
//            // TODO: add 'error.name.required' key to your resources
//        }
//        
//        if (getEmail() == null ) {
//            errors.add("Email", new ActionMessage("email"));
//            // TODO: add 'error.name.required' key to your resources
//        }
//          SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
//        
//        try{
//           Date dd= sdf.parse(getBirthday());
//            System.out.println(" dd "+dd.toString());
//            
//            
//         
//        }
//        catch(Exception c)
//        {
//            errors.add("birthday", new ActionMessage("birthday"));
//    
//        }
//      
        return errors;
    }
}
